﻿@model IEnumerable<Asset_Management.Models.Product>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            ProductID
        </th>
        <th>
            @Html.ActionLink("ProductName", "Index", new {sortOrder = ViewBag.ProductNameSortParm})
        </th>
        <th>
            @Html.ActionLink("SerialNumber", "Index", new {sortOrder = ViewBag.SerialNumberSortParm})
        </th>
        <th>
            Provider
        </th>
        <th>
            @Html.ActionLink("OfficeID", "Index", new {sortOrder = ViewBag.OfficeIDSortParm})
        </th>
        <th>
            @Html.ActionLink("DateBuyed", "Index", new {sortOrder = ViewBag.DateBuyedSortParm})
        </th>
        <th>
            @Html.ActionLink("InputBy", "Index", new {sortOrder = ViewBag.InputBySortParm})
        </th>
        <th>
            @Html.ActionLink("AcceptBy", "Index", new {sortOrder = ViewBag.AcceptBySortParm})
        </th>
        <th>
            @Html.ActionLink("PriceUnit", "Index", new {sortOrder = ViewBag.PriceUnitSortParm})
        </th>
        <th>
            @Html.ActionLink("Status", "Index", new {sortOrder = ViewBag.StatusSortParm})
        </th>
        <th>
            @Html.ActionLink("DateExpireMaintenance", "Index", new {sortOrder = ViewBag.DateExpireMaintenanceSortParm})
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.ProductID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ProductName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.SerialNumber)
        </td>
        <td>
            @Html.ActionLink("abc","index","Provider")
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OfficeID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DateBuyed)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.InputBy)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.AcceptBy)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PriceUnit)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Status)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DateExpireMaintenance)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ProductID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ProductID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ProductID })
        </td>
    </tr>
}

</table>
